package com.archerdu.apply.model;

// Generated 2013-11-1 14:22:25 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.Set;

import com.archerdu.base.dao.BaseEntity;

/**
 * Entity: 
 */
public class Member implements BaseEntity<Integer> {

    private static final long serialVersionUID = 1L;

    /** 
     * 主键.
     */
    private Integer           id;

    /** 
     * 登陆名.
     */
    private String            loginname;

    /** 
     * 密码，md5值.
     */
    private String            pwd;

    /** 
     * email.
     */
    private String            email;

    /** 
     * 密保问题.
     */
    private String            pwdQuestion;

    /** 
     * 密保答案.
     */
    private String            pwdAnswer;

    /** 
     * 用户类型.
     */
    private String            memberType;

    /** 
     * 用户等级.
     */
    private Integer           memberlevel;

    /** 
     * 用户标识.
     */
    private String         flag;

    /** 
     * 用户标识.
     */
    private Integer         useFlag;

    /** 
     * 注册公司.
     */
    private Integer           companyId;

    /** 
     * 公司名称，关联公司后取关联公司名，否则手动填写.
     */
    private String            company;

    /** 
     * 部门.
     */
    private String            department;

    /** 
     * 真实姓名.
     */
    private String            name;

    /** 
     * 电话.
     */
    private String            phone;

    /** 
     * 分机号.
     */
    private String            extention;

    /** 
     * 手机号码.
     */
    private String            mobile;

    /** 
     * 国家.
     */
    private String            country;

    /** 
     * 省.
     */
    private String            province;

    /** 
     * 市.
     */
    private String            city;

    /** 
     * 区县.
     */
    private String            county;

    /** 
     * 地址.
     */
    private String            address;

    /** 
     * 邮编.
     */
    private String            zipcode;

    /** 
     * 注册时间.
     */
    private Date              regtime;

    /** 
     * 最后登录时间.
     */
    private Date              loginTime;

    /** 
     * 最后修改时间.
     */
    private Date              updateTime;

    /** 
     * 注册ip.
     */
    private String            regIp;

    /** 
     * 注册ip.
     */
    private String            registerIp;

    /** 
     * 最后登录ip.
     */
    private String            lastloginIp;

    /** 
     * 登录次数.
     */
    private Integer           logincount;

    /** 
     * 激活码.
     */
    private String            activeCode;

    /**
     * 角色
     */
    private Set<Role> roles;
    
    public Member() {
    }

    public Member(String loginname, String pwd, String email, Date regtime) {
        this.loginname = loginname;
        this.pwd = pwd;
        this.email = email;
        this.regtime = regtime;
    }

    public Member(String loginname, String pwd, String email, String pwdQuestion, String pwdAnswer,
            String memberType, Integer memberlevel, String flag, Integer companyId, String company,
            String department, String name, String phone, String extention, String mobile, String country,
            String province, String city, String county, String address, String zipcode, Date regtime, Date loginTime,
            Date updateTime, String regIp, String registerIp, String lastloginIp, Integer logincount, String activeCode) {
        this.loginname = loginname;
        this.pwd = pwd;
        this.email = email;
        this.pwdQuestion = pwdQuestion;
        this.pwdAnswer = pwdAnswer;
        this.memberType = memberType;
        this.memberlevel = memberlevel;
        this.flag = flag;
        this.companyId = companyId;
        this.company = company;
        this.department = department;
        this.name = name;
        this.phone = phone;
        this.extention = extention;
        this.mobile = mobile;
        this.country = country;
        this.province = province;
        this.city = city;
        this.county = county;
        this.address = address;
        this.zipcode = zipcode;
        this.regtime = regtime;
        this.loginTime = loginTime;
        this.updateTime = updateTime;
        this.regIp = regIp;
        this.registerIp = registerIp;
        this.lastloginIp = lastloginIp;
        this.logincount = logincount;
        this.activeCode = activeCode;
    }

    /**
     * toJson
     * 
     * @return String
     */
    public String toJson() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("{");
        buffer.append("\"loginname\":\"" + loginname + "\",");
        buffer.append("\"pwd\":\"" + pwd + "\",");
        buffer.append("\"email\":\"" + email + "\",");
        buffer.append("\"pwdQuestion\":\"" + pwdQuestion + "\",");
        buffer.append("\"pwdAnswer\":\"" + pwdAnswer + "\",");
        buffer.append("\"memberType\":\"" + memberType + "\",");
        buffer.append("\"memberlevel\":\"" + memberlevel + "\",");
        buffer.append("\"flag\":\"" + flag + "\",");
        buffer.append("\"companyId\":\"" + companyId + "\",");
        buffer.append("\"company\":\"" + company + "\",");
        buffer.append("\"department\":\"" + department + "\",");
        buffer.append("\"name\":\"" + name + "\",");
        buffer.append("\"phone\":\"" + phone + "\",");
        buffer.append("\"extention\":\"" + extention + "\",");
        buffer.append("\"mobile\":\"" + mobile + "\",");
        buffer.append("\"country\":\"" + country + "\",");
        buffer.append("\"province\":\"" + province + "\",");
        buffer.append("\"city\":\"" + city + "\",");
        buffer.append("\"county\":\"" + county + "\",");
        buffer.append("\"address\":\"" + address + "\",");
        buffer.append("\"zipcode\":\"" + zipcode + "\",");
        buffer.append("\"regtime\":\"" + regtime + "\",");
        buffer.append("\"loginTime\":\"" + loginTime + "\",");
        buffer.append("\"updateTime\":\"" + updateTime + "\",");
        buffer.append("\"regIp\":\"" + regIp + "\",");
        buffer.append("\"registerIp\":\"" + registerIp + "\",");
        buffer.append("\"lastloginIp\":\"" + lastloginIp + "\",");
        buffer.append("\"logincount\":\"" + logincount + "\",");
        buffer.append("\"activeCode\":\"" + activeCode + "\",");
        buffer.deleteCharAt(buffer.length() - 1);
        buffer.append("}");
        return buffer.toString();
    }

    @Override
    public String toString() {

        StringBuffer buffer = new StringBuffer();

        buffer.append("[");

        buffer.append("\"登陆名\":\"" + loginname + "\",");

        buffer.append("\"密码，md5值\":\"" + pwd + "\",");

        buffer.append("\"email\":\"" + email + "\",");

        buffer.append("\"密保问题\":\"" + pwdQuestion + "\",");

        buffer.append("\"密保答案\":\"" + pwdAnswer + "\",");

        buffer.append("\"用户类型\":\"" + memberType + "\",");

        buffer.append("\"用户等级\":\"" + memberlevel + "\",");

        buffer.append("\"用户标识\":\"" + flag + "\",");

        buffer.append("\"注册公司\":\"" + companyId + "\",");

        buffer.append("\"公司名称，关联公司后取关联公司名，否则手动填写\":\"" + company + "\",");

        buffer.append("\"部门\":\"" + department + "\",");

        buffer.append("\"真实姓名\":\"" + name + "\",");

        buffer.append("\"电话\":\"" + phone + "\",");

        buffer.append("\"分机号\":\"" + extention + "\",");

        buffer.append("\"手机号码\":\"" + mobile + "\",");

        buffer.append("\"国家\":\"" + country + "\",");

        buffer.append("\"省\":\"" + province + "\",");

        buffer.append("\"市\":\"" + city + "\",");

        buffer.append("\"区县\":\"" + county + "\",");

        buffer.append("\"地址\":\"" + address + "\",");

        buffer.append("\"邮编\":\"" + zipcode + "\",");

        buffer.append("\"注册时间\":\"" + regtime + "\",");

        buffer.append("\"最后登录时间\":\"" + loginTime + "\",");

        buffer.append("\"最后修改时间\":\"" + updateTime + "\",");

        buffer.append("\"注册ip\":\"" + regIp + "\",");

        buffer.append("\"注册ip\":\"" + registerIp + "\",");

        buffer.append("\"最后登录ip\":\"" + lastloginIp + "\",");

        buffer.append("\"登录次数\":\"" + logincount + "\",");

        buffer.append("\"激活码\":\"" + activeCode + "\",");

        buffer.deleteCharAt(buffer.length() - 1);
        buffer.append("]");
        return buffer.toString();
    }

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLoginname() {
        return this.loginname;
    }

    public void setLoginname(String loginname) {
        this.loginname = loginname;
    }

    public String getPwd() {
        return this.pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPwdQuestion() {
        return this.pwdQuestion;
    }

    public void setPwdQuestion(String pwdQuestion) {
        this.pwdQuestion = pwdQuestion;
    }

    public String getPwdAnswer() {
        return this.pwdAnswer;
    }

    public void setPwdAnswer(String pwdAnswer) {
        this.pwdAnswer = pwdAnswer;
    }

    public String getMemberType() {
        return this.memberType;
    }

    public void setMemberType(String memberType) {
        this.memberType = memberType;
    }

    public Integer getMemberlevel() {
        return this.memberlevel;
    }

    public void setMemberlevel(Integer memberlevel) {
        this.memberlevel = memberlevel;
    }

    public String getFlag() {
        return this.flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public Integer getCompanyId() {
        return this.companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getCompany() {
        return this.company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getDepartment() {
        return this.department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getExtention() {
        return this.extention;
    }

    public void setExtention(String extention) {
        this.extention = extention;
    }

    public String getMobile() {
        return this.mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getCountry() {
        return this.country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return this.province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return this.city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCounty() {
        return this.county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipcode() {
        return this.zipcode;
    }

    public void setZipcode(String zipcode) {
        this.zipcode = zipcode;
    }

    public Date getRegtime() {
        return this.regtime;
    }

    public void setRegtime(Date regtime) {
        this.regtime = regtime;
    }

    public Date getLoginTime() {
        return this.loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getRegIp() {
        return this.regIp;
    }

    public void setRegIp(String regIp) {
        this.regIp = regIp;
    }

    public String getRegisterIp() {
        return this.registerIp;
    }

    public void setRegisterIp(String registerIp) {
        this.registerIp = registerIp;
    }

    public String getLastloginIp() {
        return this.lastloginIp;
    }

    public void setLastloginIp(String lastloginIp) {
        this.lastloginIp = lastloginIp;
    }

    public Integer getLogincount() {
        return this.logincount;
    }

    public void setLogincount(Integer logincount) {
        this.logincount = logincount;
    }

    public String getActiveCode() {
        return this.activeCode;
    }

    public void setActiveCode(String activeCode) {
        this.activeCode = activeCode;
    }

    public Integer getUseFlag() {
        return useFlag;
    }

    public void setUseFlag(Integer useFlag) {
        this.useFlag = useFlag;
    }

    public Set<Role> getRoles() {
        return roles;
    }

    public void setRoles(Set<Role> roles) {
        this.roles = roles;
    }

}
